using Godot;

namespace PlayerState
{
public partial class Idle : Node,StateNode
{
    public void OnEnter()
    {
        GetNode<AnimatedSprite2D>("../../AnimaPlayer").Animation = "idle";        
    }

    public void OnExit(){}

    public void OnUpdate(float delta)
    {
        Player player = GetNode<Player>("/root/Main/Player");

        if(player.Health<=0)
            player.SwitchTo("Dead");        
        else if(player.IsRun())
            player.SwitchTo("Run");
    }
}
}
